﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xts
{
    namespace Util
    {
        //Interface of Product Class for the Thread Safe Producer-Consumer model
        public interface IXRequestJob
        {
            bool Execute();
            //"Execute" should be realized in derived class. When "Execute" return false, working thread would end.
            //Any Job, except XEndingReaderJob objcet, should return true.
        }

        //XEndingReaderJob is used to end working thread. 
        //When you want to end a Thread Safe Producer-Consumer model's all working Thread, 
        //add the same number XEndingReaderJob objects with working threads to Job queue.
        public class XEndingReaderJob : IXRequestJob
        {
            public bool Execute() { return false; }
        }
    }
}